package org.cornland.systemWarning.service.impl;

import org.cornland.systemWarning.model.Well;
import org.cornland.systemWarning.mapper.WellMapper;
import org.cornland.systemWarning.service.WellService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import lombok.extern.slf4j.Slf4j;

import java.util.List;

/**
 * <p>
 * 单井基础信息 服务实现类
 * </p>
 *
 * @author Hawk Tang
 * @since 2021-11-08
*/


@Service
@Slf4j
public class WellServiceImpl extends ServiceImpl<WellMapper, Well> implements WellService {

   @Autowired
   private WellMapper wellMapper;

   public Well selectByPrimaryKey(Integer id){
        Well well = wellMapper.selectById(id);
        return well;
   }

   public List<Well> selectAll(){
        List<Well> wellList = wellMapper.selectList(null);
        return wellList;
   }

   public Integer insert(Well well){
        int result = wellMapper.insert(well);
        return result;
   }

   public Integer updateByPrimaryKey(Well well){
        int result = wellMapper.updateById(well);
        return result;
   }

   public Integer deleteByPrimaryKey(Integer id){
        int result = wellMapper.deleteById(id);
        return result;
   }







}